group '{{groupId}}'
version '{{artifactVersion}}'

wrapper {
    gradleVersion = '7.5'
    distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}

buildscript {
    ext.kotlin_version = '1.8.0'
    ext.ktor_version = "1.5.4"
    ext.shadow_version = "6.1.0"

    repositories {
        maven {
            url "https://repo1.maven.org/maven2"
        }
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version"
    }
}

apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'

mainClassName = "io.ktor.server.netty.DevelopmentEngine"

apply plugin: 'com.github.johnrengelman.shadow'

sourceCompatibility = 1.8

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

shadowJar {
    baseName = '{{artifactId}}'
    classifier = null
    version = null
}

repositories {
    mavenCentral()
    maven { url  "https://dl.bintray.com/kotlin/ktor" }
    maven { url "https://dl.bintray.com/kotlin/kotlinx" }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation "io.ktor:ktor-server-netty:$ktor_version"
    implementation "io.ktor:ktor-metrics:$ktor_version"
    implementation "io.ktor:ktor-locations:$ktor_version"
    implementation "io.ktor:ktor-gson:$ktor_version"
    implementation "io.ktor:ktor-client-core:$ktor_version"
    implementation "io.ktor:ktor-client-apache:$ktor_version"
    implementation "ch.qos.logback:logback-classic:1.2.9"
    testImplementation group: 'junit', name: 'junit', version: '4.12'
}
